<html>
<head><meta charset="utf-8"><title>gdb not running target on mac os · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html">gdb not running target on mac os</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220417380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220417380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220417380">(Dec 18 2020 at 19:26)</a>:</h4>
<p>Hi team, cross posting this from the discord group. Would anyone know how to get  past this error on while using GDB on mac os big sur</p>



<a name="220417394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220417394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220417394">(Dec 18 2020 at 19:26)</a>:</h4>
<div class="codehilite"><pre><span></span><code> gdb -q target/thumbv7m-none-eabi/debug/logging
&quot;0x7ffee34085b0s&quot;: not in executable format: file format not recognized
(gdb)
</code></pre></div>



<a name="220417497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220417497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220417497">(Dec 18 2020 at 19:27)</a>:</h4>
<p>Thank you so much for the time</p>



<a name="220417836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220417836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220417836">(Dec 18 2020 at 19:30)</a>:</h4>
<p>Are you trying to execute thumbv7m code on your mac?</p>



<a name="220417862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220417862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220417862">(Dec 18 2020 at 19:30)</a>:</h4>
<p>No the target is a stm32f103 board</p>



<a name="220418225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418225">(Dec 18 2020 at 19:33)</a>:</h4>
<p>You'll need the gdb for the relevant target first (most likely going to be named as <code>arm-none-eabi-gdb</code>), rather than a host gdb.</p>



<a name="220418267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418267">(Dec 18 2020 at 19:33)</a>:</h4>
<p>I am following this guide</p>



<a name="220418344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418344">(Dec 18 2020 at 19:34)</a>:</h4>
<p>Aha let me try use a specific gdb</p>



<a name="220418454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418454">(Dec 18 2020 at 19:35)</a>:</h4>
<p>If <code>arm-none-eabi-gdb $executable</code> does not work you can also try executing the load command manually by typing </p>
<div class="codehilite"><pre><span></span><code>file target/thumbv7m-none-eabi/debug/logging
</code></pre></div>
<p>into prompt or as an <code>-ex</code> cli argument:</p>
<div class="codehilite"><pre><span></span><code>arm-none-eabi-gdb -ex &quot;file ...&quot;
</code></pre></div>



<a name="220418509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418509">(Dec 18 2020 at 19:35)</a>:</h4>
<p>Should I just use the gdb  I have installed</p>



<a name="220418518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418518">(Dec 18 2020 at 19:35)</a>:</h4>
<p>This is what my typical gdb invocation looks like (though its using a black magic probe, rather than a built-in stm32 programmer, typically present on most stm32 devboards)</p>



<a name="220418598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418598">(Dec 18 2020 at 19:36)</a>:</h4>
<p>I just tried installing this specific gdb</p>



<a name="220418600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418600">(Dec 18 2020 at 19:36)</a>:</h4>
<p>=&gt; Searching for similarly named formulae...<br>
Error: No similarly named formulae found.<br>
Error: No available formula or cask with the name "arm-none-eabi-gdb".<br>
==&gt; Searching for a previously deleted formula (in the last month)...<br>
Error: No previously deleted formula found.<br>
==&gt; Searching taps on GitHub...<br>
Error: No formulae found in taps.</p>



<a name="220418601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418601">(Dec 18 2020 at 19:36)</a>:</h4>
<div class="codehilite"><pre><span></span><code>arm-none-eabi-gdb -ex &quot;target extended-remote /dev/ttyACM0&quot; \
-ex &quot;monitor swdp_scan&quot; \
-ex &quot;attach 1&quot; \
-ex &quot;load target/thumbv7m-none-eabi/release/firmware&quot; \
-ex &quot;file target/thumbv7m-none-eabi/release/firmware&quot; \
-ex &quot;compare-sections&quot; \
-ex &quot;c&quot;
</code></pre></div>
<p>It connects to the target, programs, and verifies firmware in one go.</p>



<a name="220418633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418633">(Dec 18 2020 at 19:36)</a>:</h4>
<p>I can't help you with brew, not a mac user, sorry.</p>



<a name="220418795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418795">(Dec 18 2020 at 19:38)</a>:</h4>
<p>I don't know how embedded works - is this a chip with an operating system? If so you might be able to run gdb on the board itself</p>



<a name="220418836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418836">(Dec 18 2020 at 19:38)</a>:</h4>
<p>Or you could try QEMU or something</p>



<a name="220418843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418843">(Dec 18 2020 at 19:39)</a>:</h4>
<p><span class="user-mention" data-user-id="368758">@Zacck Osiemo</span> Do you deliberately <em>want</em> to use GDB or are you fine with pure-Rust tools for flashing?</p>



<a name="220418868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418868">(Dec 18 2020 at 19:39)</a>:</h4>
<p>I am trying to use what is easiest</p>



<a name="220418880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418880">(Dec 18 2020 at 19:39)</a>:</h4>
<p>It seems like running</p>



<a name="220418904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418904">(Dec 18 2020 at 19:39)</a>:</h4>
<p>Because I can highly recommend using <code>probe-run</code> or <code>cargo-embed</code></p>



<a name="220418915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418915">(Dec 18 2020 at 19:39)</a>:</h4>
<p>arm-none-eabi-gdb file</p>



<a name="220418923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418923">(Dec 18 2020 at 19:39)</a>:</h4>
<p>works</p>



<a name="220418929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220418929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220418929">(Dec 18 2020 at 19:39)</a>:</h4>
<p>That should be much easier</p>



<a name="220419016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220419016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220419016">(Dec 18 2020 at 19:40)</a>:</h4>
<p>Links:</p>
<ul>
<li><a href="https://github.com/knurling-rs/probe-run">https://github.com/knurling-rs/probe-run</a></li>
<li><a href="https://github.com/probe-rs/cargo-embed">https://github.com/probe-rs/cargo-embed</a></li>
</ul>



<a name="220419305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220419305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220419305">(Dec 18 2020 at 19:42)</a>:</h4>
<p>Turns out all I needed was to install normal gdb</p>



<a name="220419308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220419308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220419308">(Dec 18 2020 at 19:42)</a>:</h4>
<p>and run</p>



<a name="220419330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220419330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220419330">(Dec 18 2020 at 19:42)</a>:</h4>
<div class="codehilite"><pre><span></span><code>arm-none-eabi-gdb target/thumbv7m-none-eabi/debug/logging
</code></pre></div>



<a name="220419365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220419365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220419365">(Dec 18 2020 at 19:42)</a>:</h4>
<p>this gets me semihosting and logs on ocd</p>



<a name="220419485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220419485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220419485">(Dec 18 2020 at 19:43)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span>  erm someone suggested cargo embed earlier, I didn't get to trying it yet</p>



<a name="220419499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/gdb%20not%20running%20target%20on%20mac%20os/near/220419499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zacck Osiemo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/gdb.20not.20running.20target.20on.20mac.20os.html#220419499">(Dec 18 2020 at 19:43)</a>:</h4>
<p>will look into these</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>